package com.itheima.common.domain;

import lombok.Data;

import java.util.List;

/**
 * 分页返回对象
 * @param <T>
 */
@Data
public class PageResDto<T> extends R{

    private Integer currentPage;
    private Integer size;
    private Integer total;
    private List<T> data;
    public PageResDto(Integer currentPage, Integer size, Integer total, List<T> data)
    {
        this.currentPage = currentPage;
        this.size = size;
        this.total = total;
        this.data = data;
    }

    public PageResDto(PageReqDto dto, Long total, List<T> data)
    {
        this.currentPage = dto.getPage();
        this.size = dto.getSize();
        this.total = total.intValue();
        this.data = data;
    }

    public PageResDto()
    {
    }


}
